<template>
  <div class="box">
    <div>
      <keep-alive>
        <router-link to="/A">组件A</router-link>
      </keep-alive>
      <br />
      <keep-alive>
        <router-link to="/B">组件B</router-link>
      </keep-alive>
    </div>
    <div>
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
import ComponentA from "@/view/keep-alive/componentA.vue";
import ComponentB from "@/view/keep-alive/componentB.vue";
export default {
  name: "KeepAliveDemo",
  components: {
    ComponentA,
    ComponentB
  }
};
</script>
